package com.zhaoc.service;


import com.zhaoc.domain.Customer;

import javax.ws.rs.*;
import java.util.List;

/**
 * <p>title:com.zhaoc.service</p>
 * date:2018/8/4 0004
 * time:18:49
 * author:赵成
 * user:13566
 */

public interface CustomerService{

    //查询所有未关联客户列表
    @Path("/noassociationcustomers")
    @GET
    @Produces({"application/xml", "application/json"})
    public List<Customer> findNoAssociationCustomers();

    //查询所有已关联的客户列表
    @Path("/associationfixedareacustomers/{fixedareaid}")
    @GET
    @Produces({"application/xml", "application/json"})
    public List<Customer> findHasAssociationFixedareaCustomers(
            @PathParam("fixedareaid") String fixedAreaId);

    //将客户关联到定区上,将所有客户id拼成一个字符串1,2,3
    @Path("/associationCustomersToFixedarea")
    @PUT
    public void associationCustomersToFixedarea(
            @QueryParam("customersIdStr") String customersIdStu,
            @QueryParam("fixedAreaId") String fixedAreaId
    );

    //保存客户注册信息
    @Path("/customer")
    @POST
    public void saveCustomer(Customer customer);

    //查询账户
    @Path("/customer/telephone/{telephone}")
    @GET
    @Produces({"application/xml", "application/json"})
    public Customer findCustomer(@PathParam("telephone") String telephone);

    //修改邮箱激活状态
    @Path("/customer/updateType/{telephone}")
    @GET
    public void updateCustomerType(@PathParam("telephone") String telephone);

    //用户登陆
    @Path("/customer/login")
    @GET
    @Consumes({"application/xml", "application/json"})
    public Customer login(@QueryParam("telephone") String telephone,
                   @QueryParam("password") String password);


    //根据详细地址获取定区ID
    @Path("/customer/findFixedAreaIdByAddress")
    @GET
    @Consumes({"application/xml", "application/json"})
    String findFixedAreaIdByAddress(@QueryParam("address") String address);
}
